package com.sxx.beautifulcity.database;

import com.sxx.beautifulcity.entity.greendao.AgritourismDaoEntity;
import com.sxx.beautifulcity.entity.greendao.AgritourismDaoEntityDao;

import java.util.List;

/**
 * Created by dllo on 15/11/2.
 */
public class AgritourismHelper {

    private DaoSingleton instance = DaoSingleton.getInstance();
    private AgritourismDaoEntityDao agritourismDao;

    public AgritourismHelper() {
        this.agritourismDao = instance.getAgritourismDao();
    }

    /***
     * 添加数据
     */
    public void saveAgritourismList(List<AgritourismDaoEntity> entities) {
            agritourismDao.insertInTx(entities);
    }
    /***
     * 删除数据
     */
    public void deleteAgritourismList(List<AgritourismDaoEntity> entities){
        agritourismDao.deleteAll();
    }

    /***
     * 查询
     */
    public List<AgritourismDaoEntity> queryAllAgritourism(){
        return agritourismDao.loadAll();
    }

}
